package cn.hloger.spider.demo.webSocketDemo.service;

import javax.websocket.Session;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

public class ChatRoomHandle extends SessionHandle {
    final static String ORDER_1 = "成员列表";

    final static String RESULT = "未查询到命令";

    public static String handleAdminOrder(String message, ConcurrentHashMap<String, Session> sessionPools) {
        if (message.equals(ORDER_1)) {
            return sessionPools.values().stream().map(SessionHandle::getNameBySession)
                    .collect(Collectors.joining("\r\n"));
        }
        return RESULT;
    }

}
